﻿@namespace BootstrapBlazor.Components
@typeparam TModel
@inherits DialogBase<TModel>

@if (BodyTemplate != null)
{
    @BodyTemplate?.Invoke(Model)
    @RenderFooter
}
else
{
    <CascadingValue Value="Items" IsFixed="true">
        <EditorForm TModel="TModel" Model="Model">
            <Buttons>
                @RenderFooter
            </Buttons>
        </EditorForm>
    </CascadingValue>
}

@code {
    RenderFragment RenderFooter =>
    @<div class="modal-footer table-modal-footer">
        <Button Color="Color.Info" Icon="fa fa-trash-o" Text="@ResetButtonText" OnClickWithoutRender="@OnResetSearchClick" />
        <Button Color="Color.Primary" Icon="fa fa-search" Text="@QueryButtonText" OnClickWithoutRender="@OnSearchClick" />
    </div>;
}
